package easy;

public class Solution_746 {

    public int minCostClimbingStairs(int[] cost) {
        int[] ints = new int[cost.length + 1];
        for (int i = 2; i <= cost.length; i++) {
            ints[i] = Math.min(ints[i - 1] + cost[i - 1], ints[i - 2] + cost[i - 2]);
        }
        return ints[cost.length];
    }

    public static void main(String[] args) {
        Solution_746 model = new Solution_746();
        System.out.println(model.minCostClimbingStairs(new int[]{10, 15, 20}));
        System.out.println(model.minCostClimbingStairs(new int[]{1, 100, 1, 1, 1, 100, 1, 1, 100, 1}));
    }
}
